package Administrator.Login.AdministratorLoginView;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.EventQueue;
import java.awt.Font;
import javax.swing.JButton;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.WindowConstants;

public class AdministratorLoginView 
{

	public JButton loadFileButton;
	public JLabel loginStatusLabel;
	public JButton exitButton;
	public JButton loginButton;
	public JPasswordField passwordField;
	private JLabel passwordLabel;
	public JTextField userNameTextField;
	private JLabel usernameLabel;
	private JLabel acmContestJudgeLabel;
	public JFrame frame;

	/**
	 * Launch the application
	 * @param args
	 */
	public static void main(String args[]) 
	{
		try
		{
		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		EventQueue.invokeLater(new Runnable() 
		{
			public void run() 
			{
				try 
				{
					AdministratorLoginView window = new AdministratorLoginView();
					window.frame.setVisible(true);
				} 
				catch (Exception e) 
				{
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application
	 */
	public AdministratorLoginView() 
	{
		try
		{
		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		createContents();
		
		frame.setVisible(true);
	}

	/**
	 * Initialize the contents of the frame
	 */
	private void createContents() {
		frame = new JFrame();
		frame.setTitle("Administrator Login System");
		frame.setBounds(100, 100, 500, 375);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

		final Container container = new Container();
		container.setLayout(null);
		container.setFont(new Font("Dialog", Font.PLAIN, 5));
		frame.getContentPane().add(container, BorderLayout.CENTER);

		acmContestJudgeLabel = new JLabel();
		acmContestJudgeLabel.setForeground(new Color(255, 0, 0));
		acmContestJudgeLabel.setFont(new Font("Dialog", Font.PLAIN, 16));
		acmContestJudgeLabel.setText("ACM Contest Judge System");
		acmContestJudgeLabel.setBounds(115, 10, 233, 36);
		container.add(acmContestJudgeLabel);

		usernameLabel = new JLabel();
		usernameLabel.setForeground(new Color(255, 0, 0));
		usernameLabel.setFont(new Font("Dialog", Font.PLAIN, 9));
		usernameLabel.setText("UserName");
		usernameLabel.setBounds(115, 91, 66, 18);
		container.add(usernameLabel);

		userNameTextField = new JTextField();
		userNameTextField.setBounds(115, 122, 262, 22);
		container.add(userNameTextField);

		passwordLabel = new JLabel();
		passwordLabel.setText("password");
		passwordLabel.setBounds(115, 167, 66, 18);
		container.add(passwordLabel);

		passwordField = new JPasswordField();
		passwordField.setBounds(115, 199, 262, 21);
		container.add(passwordField);

		loginButton = new JButton();
		loginButton.setText("Login");
		loginButton.setBounds(115, 252, 66, 23);
		container.add(loginButton);

		exitButton = new JButton();
		exitButton.setText("Exit");
		exitButton.setBounds(311, 252, 66, 23);
		container.add(exitButton);

		loginStatusLabel = new JLabel();
		loginStatusLabel.setBounds(115, 300, 307, 22);
		container.add(loginStatusLabel);

		loadFileButton = new JButton();
		loadFileButton.setText("LoadFile");
		loadFileButton.setBounds(201, 252, 92, 23);
		container.add(loadFileButton);

		final JLabel administratorLabel = new JLabel();
		administratorLabel.setText("Administrator");
		administratorLabel.setBounds(327, 22, 95, 15);
		container.add(administratorLabel);
	}

}
